<template>
  <div class="devices-container">
    <el-card class="box-card">
      <template #header>
        <div class="card-header">
          <span>设备列表</span>
          <el-button type="primary" size="small">刷新数据</el-button>
        </div>
      </template>
      
      <el-table :data="deviceList" style="width: 100%">
        <el-table-column prop="name" label="设备名称" />
        <el-table-column prop="type" label="设备类型" />
        <el-table-column prop="status" label="运行状态">
          <template #default="scope">
            <el-tag :type="scope.row.status === 'normal' ? 'success' : 'danger'">
              {{ scope.row.status === 'normal' ? '正常' : '异常' }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="power" label="功率(kW)" />
        <el-table-column prop="updateTime" label="更新时间" />
      </el-table>
    </el-card>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const deviceList = ref([
  {
    name: '1#逆变器',
    type: '逆变器',
    status: 'normal',
    power: 100,
    updateTime: '2024-01-18 10:00:00'
  }
])
</script>

<style lang="scss" scoped>
.devices-container {
  padding: 20px;
  
  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}
</style> 